from selenium.webdriver.common.by import By
from common.Utils import BlogDriver


class BlogDetail:
    url = ''
    driver = ''
    def __init__(self):
        self.url = 'http://113.45.147.167:9090/blog_detail.html?blogId=3'
        self.driver = BlogDriver.driver
        self.driver.get(self.url)

    def DetailTestByLogin(self):
        # 检查标题
        self.driver.find_element(By.CSS_SELECTOR, 'body > div.container > div.right > div > div.title')
        # 检查时间
        self.driver.find_element(By.CSS_SELECTOR, 'body > div.container > div.right > div > div.date')
        # 检查内容
        self.driver.find_element(By.CSS_SELECTOR, '#detail')
        # 检查屏幕截图
        BlogDriver.getScreeShot()